{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from gs_quant.data.fields import DataMeasure\n",
    "from gs_quant.markets.baskets import Basket\n",
    "from gs_quant.session import Environment, GsSession"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "client = 'CLIENT ID'\n",
    "secret = 'CLIENT SECRET'\n",
    "\n",
    "GsSession.use(Environment.PROD, client_id=client, client_secret=secret, scopes=('read_product_data read_user_profile',))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "basket = Basket.get('GSMBXXXX') # substitute input with any identifier for a basket"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You may choose any combinations of the following metrics:\n",
    "\n",
    "* **Dividend Yield:** DataMeasure.*DIVIDEND_YIELD*\n",
    "* **Earnings per Share:** DataMeasure.*EARNINGS_PER_SHARE*\n",
    "* **Earnings per Share Positive:** DataMeasure.*EARNINGS_PER_SHARE_POSITIVE*\n",
    "* **Net Debt to EBITDA:** DataMeasure.*NET_DEBT_TO_EBITDA*\n",
    "* **Price to Book:** DataMeasure.*PRICE_TO_BOOK*\n",
    "* **Price to Cash:** DataMeasure.*PRICE_TO_CASH*\n",
    "* **Price to Earnings:** DataMeasure.*PRICE_TO_EARNINGS*\n",
    "* **Price to Earnings Positive:** DataMeasure.*PRICE_TO_EARNINGS_POSITIVE*\n",
    "* **Price to Sales:** DataMeasure.*PRICE_TO_SALES*\n",
    "* **Return on Equity:** DataMeasure.*RETURN_ON_EQUITY*\n",
    "* **Sales per Share:** DataMeasure.*SALES_PER_SHARE*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "basket.get_fundamentals(metrics=[DataMeasure.PRICE_TO_CASH, DataMeasure.SALES_PER_SHARE])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}